# Maintainer: Alexey Pavlov <alexpux@gmail.com>

pkgname=bison
pkgver=3.0.4
pkgrel=1
pkgdesc="The GNU general-purpose parser generator"
arch=('i686' 'x86_64')
license=('GPL3')
url="http://www.gnu.org/software/bison/bison.html"
depends=('m4' 'sh')
groups=('base-devel')
options=('staticlibs')
makedepends=('flex')
install=bison.install
source=(ftp://ftp.gnu.org/gnu/bison/${pkgname}-${pkgver}.tar.xz{,.sig}
        bison-3.0.2-msys2.patch)
md5sums=('c342201de104cc9ce0a21e0ad10d4021'
         'SKIP'
         '78ca83243a879a00b46be5233cdf4cf8')

prepare() {
  cd ${srcdir}/${pkgname}-${pkgver}
  patch -p1 -i ${srcdir}/bison-3.0.2-msys2.patch

  autoreconf -vfi
}

build() {
  cd ${srcdir}/${pkgname}-${pkgver}
  ./configure --prefix=/usr
  make
}

check() {
  cd ${srcdir}/${pkgname}-${pkgver}
  make check
}

package() {
  cd ${srcdir}/${pkgname}-${pkgver}
  make DESTDIR=${pkgdir} install
}
